﻿@{
    ViewBag.Title = "news";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<ul id="resourceListing">
    <li class="resource">
        <div class="voting">
            <div class="vote up">▲</div>
            <div class="allVotes">55</div>
            <div class="vote down">▼<br /><span>402 votes</span></div>
            
        </div>
        <div class="allExceptVoting">
            <a href="http://aftonbladet.se" target="_blank"><h1>phpAcademy channel</h1></a>
            <div class="resourceTypeContainer"><div class="resourceType video"></div></div>
            <p class="addedInfo">Added <span class="boldWhite">2012-05-13</span> by <span class="boldWhite">Daniel Hallqvist</span></p>
        
        
            <img src="@Url.Content("~/Content/images/beginner.png")" alt="beginner" class="difficultyBadge" />
            <a href="http://aftonbladet.se" target="_blank" class="goto" title="Go to resource!"></a>
            <ul class="labelList">
                <li><a href="#">php</a></li>
                <li><a href="#">jQuery</a></li>
            </ul>
            <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus semper, nisl a hendrerit ultricies, tellus urna feugiat nulla, et tempus orci erat nec sem. In hac habitasse platea dictumst. Vestibulum tempor ornare elit, eu convallis risus fringilla porttitor. Cras at dictum eros. Nam commodo tempus purus, eu lacinia mauris mollis pretium. Praesent lacinia erat eu tortor fringilla sollicitudin commodo nulla elementum.</p>
            <a href="#" class="moreInfo">↓ Click for more info ↓</a>
        </div>
    </li>
    


</ul>

<script>
    $(document).ready(function () {


        $(".allExceptVoting").on("click", function (e) {

            if (e.target.localName == "a" || e.target.localName == "h1") {
                return;
            }
            var desc = $(this).find(".description");
            var moreInfo = $(this).find(".moreInfo");

            if (desc.css("display") == "none") {
                moreInfo.text("↑ Click for less info ↑");
            }

            else {
                moreInfo.text("↓ Click for more info ↓")
            }

            desc.slideToggle("fast");


        });



    });
</script>